package com.demo.plan;

import org.junit.jupiter.api.Test;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

@SpringBootTest
public class PlanTestApplication {

    @Test
    public void PlanTest() {
        // 创建一个RestTemplate实例
        RestTemplate restTemplate = new RestTemplate();

        // 发送GET请求到Controller的方法
        String url = "http://localhost:8081/plan/test"; // 替换为您的Controller方法的URL
        ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);

        // 打印响应状态和内容
        System.out.println("Response status: " + response.getStatusCode());
        System.out.println("Response body: " + response.getBody());
    }
}
